#pragma once
using namespace std;
#include<iostream>
#include<string.h>
#include<assert.h>

namespace wusaqi
{
    class string
    {
    public:
        typedef char* iterator;
        typedef const char* const_iterator;

        string(const char* str = "");
        ~string();

        const char* c_str() const;

        size_t size() const;
        char& operator[](size_t i);
        const char& operator[](size_t i) const;

        iterator begin();
        iterator end();

        void reserve(size_t i);
        void push_back(char c);
        void append(const char* str);
        string& operator+=(char ch);
        string& operator+=(const char* str);

    private:
        char* _str;
        size_t _size;
        size_t _capacity;
    };
}
